public class Bottle {
	private String label;
	private int capacity;
	private int currentVolume;

	public Bottle(String inLabel, int inCapacity) {
		label = inLabel;
		capacity = inCapacity;
		currentVolume = 0;
	}

	public String getLabel() {
		return label;
	}

	public int getCapacity() {
		return capacity;
	}

	public int getCurrentVolume() {
		return currentVolume;
	}

	public void pour(int removeAmount) {
		if (removeAmount < 0) {
			return;
		}

		int spaceLeft = currentVolume - removeAmount;

		if (removeAmount > spaceLeft) {
			currentVolume = 0;
			return;
		}

		currentVolume -= removeAmount;
	}

	public void refill(int addAmount) {
		if (addAmount < 0) {
			return;
		}

		int spaceAvailable = capacity - currentVolume;

		if (addAmount > spaceAvailable) {
			currentVolume = capacity;
			return;
		}

		currentVolume += addAmount;
	}

	public String toString() {
		String ret = "";

		ret += "Label: " + label;
		ret += " capacity: " + capacity;
		ret += " currentVolume: " + currentVolume;

		return ret;
	}
}
